/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * Project Name: lmrp-android app
 * Create Time: 16-2-16 下午6:44
 */

package com.lenovo.mso2o.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.lenovo.framework.base.ActionBarFragment;
import com.lenovo.framework.util.DLog;
import com.lenovo.mso2o.R;
import com.lenovo.mso2o.biz.AccountManagerImpl;
import com.lenovo.mso2o.conf.MSConstants;
import com.lenovo.mso2o.util.PrefExtraUtils;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * Created by hippo on 12/17/15.
 */
public class ProfileFragment extends ActionBarFragment{
    //控件绑定
    @Bind(R.id.avatar)
    ImageView avatar;
    @Bind(R.id.text_userName)
    TextView tv_userName;
    @Bind(R.id.text_userStaff)
    TextView tv_userStaff;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        tv_userName.setText(PrefExtraUtils.getString(MSConstants.UserInfoConstance.USER_ACCOUNT, ""));
        tv_userStaff.setText(PrefExtraUtils.getString(MSConstants.UserInfoConstance.USER_NAME, ""));
        return view;
    }

    @OnClick(R.id.rl_modify_password)
    public void onModifyPassword(View v){
        DLog.toast(getString(R.string.not_implement));
    }

    @OnClick(R.id.rl_modify_phone)
    public void onModifyPhone(View v){
        DLog.toast(getString(R.string.not_implement));
    }

    @OnClick(R.id.btn_loginOut)
    public void onLogout(View view){
        AccountManagerImpl.instance.reLogin();
    }
    @Override
    public int provideContentRes() {
        return R.layout.profile;
    }

    @Override
    protected void onFragmentInVisible(Bundle savedInstanceState) {

    }

    @Override
    protected void onFragmentVisible(Bundle savedInstanceState) {

    }
    @Override
    public int getActionBarRight2ResourceId() {
        return 0;
    }

    @Override
    public void onActionBarRight2Click() {

    }
}
